<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>后台管理_文章管理</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <script src="/js/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" >
    <div class="row">
        <div class="col-md-4"></div>
        <div class="col-md-8">
            <ul class="nav nav-pills" >
                <li><a href="/man/school/list">学校管理</a> </li>
                <li class="active"><a href="/man/article/list">文章管理</a></li>
                <li><a href="/man/apply/list">报名管理</a></li>
            </ul>
        </div>
    </div>
    <p class="lead"></p>
    <div class="row">
    		<div class="span4 offset7">
    			<form class="form-search" action="/man/article/list">
    				<label>名称：</label> <input type="text" name="search_LIKE_title" class="input-medium" value="${param.search_LIKE_title}">
                    <label>类别：</label> <form:select path="category">
                                            <form:options items="${categorys}"/>
                                            </form:select>
    				<button type="submit" class="btn btn-default" id="search_btn">Search</button>
                    <a class="btn btn-default" href="/man/article/add">新增</a>
    		    </form>
    	    </div>
    	</div>
    	<table id="contentTable" class="table table-striped table-bordered table-condensed">
    		<thead><tr><th>标题</th><th>文章类别</th><th>作者</th><th>来源</th><th>创建时间</th><th>操作</th></tr></thead>
    		<tbody>
    		<c:forEach items="${list.content}" var="article">
    			<tr>
    				<td><a href="/man/article/update/${article.id}">${article.title}</a></td>
                    <td>${categorys[article.category]}</td>
                    <td>${article.author}</td>
                    <td>${article.source}</td>
                    <td><fmt:formatDate  value="${article.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
    				<td><a href="/man/article/update/${article.id}">修改</a>&nbsp;&nbsp;<a href="/man/article/delete/${article.id}">删除</a></td>
    			</tr>
    		</c:forEach>
    		</tbody>
    	</table>
    	<tags:pagination page="${list}" paginationSize="5"/>
</div>
</body>
</html>